package org.ipp4j.core.standard;

public enum Quality {

	/**
	 * Draft Quality
	 */
	DRAFT(0x03),

	/**
	 * Normal Quality
	 */
	NORMAL(0x04),

	/**
	 * High Quality
	 */
	HIGH(0x05);

	int code;

	Quality(int code) {
		this.code = code;
	}

	public static Quality valueOf(byte code) {
		for (Quality quality : Quality.values()) {
			if (quality.code == code) {
				return quality;
			}
		}
		throw new IllegalArgumentException("quality code " + code
				+ " cannot be found.");
	}

	public int getCode() {
		return code;
	}

}
